﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;

namespace SmartPlant.Model.DbContext
{
    public class Item
    {
        /// <summary>
        /// 大概率同<see cref="Entities.EntityNumber"/>
        ///</summary>
        [SugarColumn(ColumnName = "ID", IsPrimaryKey = true)]
        public decimal Id { get; set; }

        /// <summary>
        /// 不是真正的表名
        ///</summary>
        [SugarColumn(ColumnName = "NAME")]
        public string Name { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DESCRIPTION")]
        public string Description { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "SOURCETABLE")]
        public decimal? Sourcetable { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "WHERECLAUSE")]
        public string Whereclause { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "APPSCHEMA")]
        public string Appschema { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "PARENTID")]
        public decimal? Parentid { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "RELATIONPATH")]
        public string Relationpath { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "OWNERID")]
        public decimal? Ownerid { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "VALIDATIONPROGID")]
        public string Validationprogid { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "MARKER")]
        public string Marker { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "INSTANCING")]
        public decimal? Instancing { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "DISPLAY")]
        public string Display { get; set; }

        /// <summary>
        ///
        ///</summary>
        [SugarColumn(ColumnName = "SPUNDO")]
        public decimal? Spundo { get; set; }

        #region 拓展

        /// <summary>
        /// sourceTable的ID值所对应的<see cref="Entities"/>
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public Entities SourceTableEntity { get; set; }

        /// <summary>
        /// 感觉就是EDE里，某个方块下所有的属性。这就导致item比如ADD_SPEC【1001】，这个地方就是空，因为对应的属性被加到component【1071】里了
        /// </summary>
        [Obsolete]
        public List<Itemattributions> ItemAttributionsList = new List<Itemattributions>();

        #endregion 拓展
    }
}
